1. Field of the Invention
The present invention relates to a virtual computer system (virtual machine system) in which a plurality of virtual machines (virtual computers) operate, and in particular, to a virtual computer system suitable for managing a schedule for allocating a CPU, in a time-sharing manner, to a plurality of guest OSes (guest operating systems) executed in the respective virtual machines, as well as a guest OS scheduling method.
2. Description of the Related Art
A virtual computer system is conventionally known which is implemented in a main frame using a virtual machine support system. The virtual machine assisted system is composed of hardware (HW). In recent years, the CPU (processor) in a personal computer (PC), which is included in HW, has supported a virtual machine support system similar to that in the main frame. Thus, even in the field of PCs, a main frame virtualization technology has been utilized. Thus, the virtualization technology (that is, the technology for virtual machines) is expected to be commonly used in PCs (PCs for individual use), PC servers, etc.
In general, a computer system such as a PC, that is, a physical machine (real computer), is composed of HW (real HW) including a CPU (real CPU), various I/O devices (real I/O devices), and a memory (real memory). A virtual machine manager (VMM) operates on the physical machine, composed of the real HW. The virtual machine manager provides a virtual machine execution environment in which a plurality of guest OSes operate.
The virtual machine manager is also called a virtual machine monitor. The virtual machine manager directly manages and virtualizes the above-described elements of the real HW to construct virtual machines. That is, the virtual machine manager constructs (generates) the virtual machines by temporally and/or spatially (regionally) allocating physical resources (HW resources) such as the real CPU, the real I/O devices, and the real memory to each of the virtual machines as a virtual CPU, virtual I/O devices, and a virtual memory. The guest OSes are loaded into the respective virtual machines and executed by the virtual CPUs in the respective virtual machines.
In this manner, the virtual machine manager provides an environment in which the guest OSes can operate simultaneously, by performing what is called guest OS scheduling in which the physical resources such as the real CPU, the real I/O devices, and the real memory are allocated to the guest OSes. That is, the virtual machine manager can manage the virtual computer system to operate the plurality of guest OSes for a particular purpose. This is a significant advantage over the conventional non-virtual computer system. However, appropriate improvements are required to allow the plurality of guest OSes to share the physical resources (HW resources) in the virtual computer system, particularly to implement real time (RT) processing.
The real time processing is temporally limited in that particular processing needs to be completed beforehand within a predetermined time. Thus, a real time OS (RTOS) is generally used as an OS (Operating System) in order to implement the real time processing. The real time OS performs priority management suitable for the real time processing in connection of the execution of an application program (process) on OS.
The real time OS is implemented so as to have a real time property. Thus, the real time OS ensures the temporal accuracy of a dispatch process of allocating a CPU to the above-described application program (real time application), responsiveness to an interruption, and the like. On the real time OS, the application programs run on the assumption that the real time property has been realized. Thus, the application program running on the real time OS can be used for, for example, severely temporally restricted control applications.
A case is assumed in which the above-described real time OS and the above-described application program, which requires the real time property, are executed on the virtual machine. In the virtual machine, a CPU is allocated to each of the guest OSes in a time-sharing manner. However, for a normal real time OS and a real time application program running on the OS, the time required for time management and processing is estimated on the assumption that the CPU is always allocated for the execution of the program.
To allow the real time OS and the real time application program running on the OS to be executed on the virtual machine, a CPU may be accurately allocated to the program at a given period for a given time. This makes the throughput for the program per unit time constant, allowing the real time property to be easily designed (estimated). That is, the real time property can be realized during the execution of the real time OS and the application program.
Technologies for general quest OS scheduling in the virtual computer system are described in Tokio Okazaki, Minoru Zensaki, “OS Series 11 VM” KYORITSU SHUPPAN CO., LTD., August 1989, p. 97 to 100 (hereinafter referred to as Document 1), Hirokazu Takahashi, “Third Virtual Machine Monitor Xen 3.0 Decoding Class, Domain Scheduling (1)”, Open Source Magazine, June 2006, SOFTBANK Creative Corp., Ltd., p. 161 to 170 (hereinafter referred to as Document 2), and Hirokazu Takahashi, “Fourth Virtual Machine Monitor Xen 3.0 Decoding Class, Domain Scheduling (2)”, Open Source Magazine, July 2006, SOFTBANK Creative Corp., Ltd., p. 147 to 155 (hereinafter referred to as Document 3).
For example, Document 1 describes a dispatch technology for allocating a CPU to the virtual machines. Document 1 discloses a “time slice quantum”, which is a unit in which a CPU is allocated. Document 1 also introduces a CPU allocation policy as a virtualization technology applied to general-purpose computers. Specifically, Document 1 discloses CPU allocation with terminal inputs from interactive users and non-interactive users taken into account. Documents 2 and 3 disclose a dispatcher and scheduling provided by virtualization software “Xen”. These documents describe a deadline-based scheduler policy called a “sefd scheduler”.
Thus, Documents 1 to 3 describe examples of a method of allocating a CPU to a plurality of guest OSes (that is, a guest OS scheduling method). The conventional guest OS scheduling methods described in Documents 1 to 3 are different from one another owing to the intended use of the virtual machines to be subjected to scheduling. However, these guest OS scheduling methods are the same in that the scheduler or dispatcher in the virtual machine manager allocates a CPU time to the plurality of guest OSes.
Recent CPUs are configured to vary an operating frequency depending on the situation. In a typical case, if the temperature of a CPU or a system (computer system) including a CPU increases abnormally, the operating frequency of the CPU (or a system including a CPU) is automatically reduced. Thus, the reduced operating frequency reduces the power consumption of the CPU and the system, enabling a rise in temperature to be stopped. Furthermore, software (SW) such as an OS is configured to, for example, instruct (set) the HW, which determines the operating frequency of the CPU, to reduce the operating frequency. This enables a reduction in the power consumption of the CPU and the system, allowing possible useless power consumption to be avoided. Of course, if the temperature lowers, the operating frequency of the CPU is returned to the original level automatically or in response to an instruction from the SW. Similarly, if a load increases, the operating frequency of the CPU is returned to the original level in response to an instruction from the SW.
However, a change in the operating frequency of a CPU (or the system including CPU) affects the throughput of the CPU. For example, a decrease in the operating frequency of a CPU generally reduces the throughput of the CPU. Such a change in the operating frequency of a CPU is very inconvenient for the real time OS and the real time application program running on the OS, which pre-estimate the time required for processing and expect CPU to execute the processing as estimated based on the CPU's capabilities. That is, a change in the operating frequency of a CPU is a factor causing an error in processing time. Thus, the real time processing with the time ensured is difficult to achieve.